function loadlast () {
	var div;
	var objs = new Array();
<?php

$saved_divs = array (
	'div1' => array ( 
		'pos_x' => 50,
		'pos_y' => 200,
		'pos_z' => 5,
		'size_x' => 200,
		'size_y' => 100,
		'type' => 'text_div',
		'content' => '1.div'
	 ),
	'div2' => array ( 
		'pos_x' => 150,
		'pos_y' => 50,
		'pos_z' => 0,
		'size_x' => 200,
		'size_y' => 100,
		'type' => 'text_div',
		'content' => '2.div'
	 )
);

$i=0;
foreach ( $saved_divs as $id => $params ) {
	echo "objs[$i] = new Array();\n";
	echo "objs[$i]['id'] = '$id';\n";
	echo "objs[$i]['type'] = '{$params['type']}';\n";
	echo "objs[$i]['size_x'] = '{$params['size_x']}px';\n";
	echo "objs[$i]['size_y'] = '{$params['size_y']}px';\n";
	echo "objs[$i]['pos_x'] = '{$params['pos_x']}px';\n";
	echo "objs[$i]['pos_y'] = '{$params['pos_y']}px';\n";
	echo "objs[$i]['pos_z'] = {$params['pos_z']};\n";
	echo "objs[$i]['content'] = '{$params['content']}';\n";
	$i++;
}

?>

	for ( i=0;  i<objs.length; i++ ) {
		div = document.createElement('div');
		document.getElementById('main_frame').appendChild(div);
		div.innerHTML = objs[i]['content'];
		div.setAttribute('id', objs[i]['id']);
		div.setAttribute('class', objs[i]['type']);
		div.style.width = objs[i]['size_x'];
		div.style.height = objs[i]['size_y'];
		div.style.left = objs[i]['pos_x'];
		div.style.top = objs[i]['pos_y'];
		div.style.zIndex = objs[i]['pos_z'];
		addFrame(div);
	}

}
